<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        if (Schema::hasTable('commerce_commodity_type')) {
            return;
        }
        Schema::create('commerce_commodity_type', function (Blueprint $table) {
            $table->comment('商品类型');
            $table->bigIncrements('id')->comment('主键ID');
            $table->string('name')->comment('商品类型名称');
            $table->string('description')->default('')->comment('商品类型描述');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('commerce_commodity_type');
    }
};